/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.easoft.code.pos.ui.bind;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Eliu
 */
public class UICallBackConfig {

    private Object tarObj;
    private Method tarMethod;

    public UICallBackConfig(Object tarObj, Method tarMethod) {
        this.tarObj = tarObj;
        this.tarMethod = tarMethod;
    }

    public Object getTarObj() {
        return tarObj;
    }

    public void setTarObj(Object tarObj) {
        this.tarObj = tarObj;
    }

    public Method getTarMethod() {
        return tarMethod;
    }

    public void setTarMethod(Method tarMethod) {
        this.tarMethod = tarMethod;
    }

    public void call() {
        try {
            this.tarMethod.invoke(tarObj, (Object) null);
        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
            Logger.getLogger(UICallBackConfig.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
